<?php
class CategoryController extends Zend_Controller_Action {

	protected $category;
	public function init() {
		$this->category = Macys_Api_V2_Catalog_Category::getInstance();
	}


	public function getcategoryv1Action() {

	}

	public function getcategoryv2Action() {

		$form = new Macys_Form_V2Category();
		$request = $this->getRequest();
		$this->category->processInputParams($request->getParams());
		if ($this->_request->isPost()) {
			$formData = $this->_request->getPost();
			if ($form->isValid($formData)) {
				$this->category->processInputParams($formData);
			}
			$form->populate($formData);
		}
		$this->category->run();



		if(!is_null($this->category->getResponse())) {
			$p = $this->category->getResponse()->getProducts();
			$catResponseInputs = $this->category->getResponse()->getInputs();
			if(!is_null($catResponseInputs))
			$form->populate($catResponseInputs);
			$this->view->productArray = $p;
		}
		$this->view->form = $form;
	}

	public function getcategoryv3Action() {
		$request = $this->getRequest();
		var_dump($request->getParams());
		$this->getHelper('viewRenderer')->setNoRender();
	}

	public function getcategoryindexv3Action() {

	}



}